home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / r / rtg_master / rtgmasterv21.0dev.lha / includes / c / rtgmaster / rtgsublibs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-07  |  13.2 KB  |  430 lines

  1. /*
  2. **     $VER: rtgsublibs.h 1.007 (07 Apr 1996)
  3. */
  4.  
  5. #ifndef RTGSUBLIBS_H
  6. #define RTGSUBLIBS_H TRUE
  7.  
  8. #ifndef UTILITY_TAGITEM_H
  9. #include "utility/tagitem.h"
  10. #endif
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include "exec/types.h"
  14. #endif
  15.  
  16. #ifndef EXEC_NODES_H
  17. #include "exec/nodes.h"
  18. #endif
  19.  
  20. // The TagItem ID's (ti_Tag values) for OpenRtgScreen()
  21.  
  22. // Information like width, height, screenmode to use, depth and overscan
  23. // information is located in the ScreenReq structure which must be passed
  24. // to OpenRtgScreen().  The RtgScreenModeReq() function creates these
  25. // ScreenReq structures for you.
  26.  
  27. #define rtg_Dummy TAG_USER
  28.  
  29. #define rtg_Buffers (rtg_Dummy + 0x01)
  30.  
  31. // [1] You can use this tag to specify the number
  32. // of screen buffers for your screen.  Setting this
  33. // to 2 or 3 will allow you to do Double or Triple
  34. // buffering.  Valid values are 1, 2 or 3.
  35.  
  36. #define rtg_Interleaved (rtg_Dummy + 0x02)
  37.  
  38. // [FALSE] Specifying TRUE will cause bitmaps to
  39. // be allocated interleaved.  OpenRtgScreen will
  40. // fail if bitplanes cannot be allocated that way
  41. // unlike Intuition/OpenScreenTagList().
  42.  
  43. #define rtg_Draggable (rtg_Dummy + 0x03)
  44.  
  45. // [TRUE] Specifying FALSE will make the screen
  46. // non-draggable.  Do not use without good reason!
  47.  
  48. #define rtg_Exclusive (rtg_Dummy + 0x04)
  49.  
  50. // [FALSE] Allows screens which won't share the
  51. // display with other screens.  Use sparingly!
  52.  
  53. // #define rtg_ChunkySupport (rtg_Dummy + 0x05)
  54. //
  55. // [0] This LONG is used to indicate which
  56. // Chunky modes this application supports.  A
  57. // set bit means the mode is supported:
  58.  
  59. // ;    ;
  60. // ;    ;    | Pixels  | Pixel|Color| Pixel
  61. // ;    ; Bit|represent| size |space| layout
  62. // ;    ;------------------------------------------------------------------
  63. // ;    ;  0  TrueColor  LONG   RGB   %00000000 rrrrrrrr gggggggg bbbbbbbb  ARGB32
  64. // ;    ;  1  TrueColor 3 BYTE  RGB   %rrrrrrrr gggggggg bbbbbbbb           RGB24
  65. // ;    ;  2  TrueColor  WORD   RGB   %rrrrrggg gggbbbbb                    RGB16
  66. // ;    ;  3  TrueColor  WORD   RGB   %0rrrrrgg gggbbbbb                    RGB15
  67. // ;    ;  4  TrueColor  LONG   BGR   %00000000 bbbbbbbb gggggggg rrrrrrrr  ABGR32
  68. // ;    ;  5  TrueColor 3 BYTE  BGR   %bbbbbbbb gggggggg rrrrrrrr           BGR24
  69. // ;    ;  6  TrueColor  WORD   BGR   %bbbbbggg gggrrrrr                    BGR16
  70. // ;    ;  7  TrueColor  WORD   BGR   %0bbbbbgg gggrrrrr                    BGR15
  71. // ;    ;  8  TrueColor  LONG   RGB   %rrrrrrrr gggggggg bbbbbbbb 00000000  RGBA32
  72. // ;    ;  9  ColorMap   BYTE   -     -                                     LUT8
  73. // ;    ; 10  Graffiti   BYTE   -     - (Graffiti style chunky, very special)
  74. // ;    ; 11  TrueColor  WORD   RGB   %gggbbbbb 0rrrrrgg                    RGB15PC
  75. // ;    ; 12  TrueColor  WORD   BGR   %gggrrrrr 0bbbbbgg                    BGR15PC
  76. // ;    ; 13  TrueColor  WORD   RGB   %gggbbbbb rrrrrggg                    RGB16PC
  77. // ;    ; 14  TrueColor  WORD   BGR   %gggrrrrr bbbbbggg                    BGR16PC
  78. // ;    ; 15  TrueColor  LONG   BGR   %bbbbbbbb gggggggg rrrrrrrr 00000000  BGRA32
  79. //;
  80. //    ; This table is by no means complete.  There are probably more modes
  81. //    ; available on common Amiga graphic cards, but I have no information
  82. //    ; on them yet.  If you know about such modes please contact me.
  83. //
  84. //    ; Setting this LONG to zero means your application doesn't support
  85. //    ; any Chunky orientated display modes.
  86. //
  87. //    #define rtg_PlanarSupport (rtg_Dummy + 0x06)
  88. //                            ;[0] This LONG is used to indicate which
  89. //                            ;Planar modes this application supports.  A
  90. //                            ;set bit means the mode is supported:
  91. //    ; Bit 0: Indicates it supports 1 bitplane non-interleaved
  92. //    ; Bit 1: Indicates it supports 2 bitplanes non-interleaved
  93. //    ; (...)
  94. //    ; Bit 7: Indicates it supports 8 bitplanes non-interleaved
  95. //
  96. //    ; Bit 16: Indicates it supports 1 bitplane interleaved
  97. //    ; Bit 17: Indicates it supports 2 bitplanes interleaved
  98. //    ; (...)
  99. //    ; Bit 23: Indicates it supports 8 bitplanes interleaved
  100. //
  101. //    ; Bit 15: Indicates it supports EHB mode (6 bitplanes) non-interleaved
  102. //    ; Bit 31: Indicates it supports EHB mode (6 bitplanes) interleaved
  103. //
  104. //    ; Note that all planar modes are color-mapped.  Bits 8-14 and 24-30
  105. //    ; are unused for now, but could be used later to support planar modes
  106. //    ; with even higher number of bitplanes.
  107. //
  108. //    ; Setting this LONG to zero means your application doesn't support
  109. //    ; any Planar orientated display modes.
  110.  
  111. // End of OpenRtgScreenTagList() enumeration ***
  112.  
  113.  
  114. // This structure is private and for the internal use of RtgMaster.library
  115. // and its sub-libraries ONLY.  This structure will change in the future.
  116.  
  117. struct RtgDimensionInfo
  118. {
  119.     ULONG Width;
  120.     ULONG Height;
  121. };
  122.  
  123. // This structure is private and for the internal use of RtgMaster.library
  124. // and its sub-libraries ONLY.  This structure will change in the future.
  125.  
  126. struct ScreenMode
  127. {
  128.     struct MinNode ScrNode;
  129.  
  130.     // ln_Succ and ln_Pred from ListNode structure
  131.  
  132.     STRPTR Name;
  133.     STRPTR Description;
  134.  
  135.     // Description of the graphics board this mode
  136.     // requires.  For example: "Standard Amiga Chipset".
  137.     // Description should not be longer than 31
  138.     // characters including terminating NULL-byte.  This
  139.     // pointer might be zero so watch out.
  140.  
  141.     ULONG GraphicsBoard;
  142.  
  143.     // The graphics board this mode requires
  144.  
  145.     ULONG ModeID;
  146.  
  147.     // ModeID (depends on sm_GraphicsBoard)
  148.  
  149.     BYTE Reserved[8];
  150.  
  151.     // 8 bytes reserved space for use of the sub-library
  152.     // who creates this ScreenMode structure.  This is
  153.     // PRIVATE to the sub-library!
  154.  
  155.     ULONG MinWidth;
  156.  
  157.     // minimum width in pixels
  158.  
  159.     ULONG MaxWidth;
  160.  
  161.     // maximum width in pixels
  162.  
  163.     ULONG MinHeight;
  164.  
  165.     // Minimum height in pixels
  166.  
  167.     ULONG MaxHeight;
  168.  
  169.     // Maximum height in pixels
  170.  
  171.     struct RtgDimensionInfo Default;
  172.  
  173.     // Standard width and height of this ScreenMode
  174.  
  175.     struct RtgDimensionInfo TextOverscan;
  176.  
  177.     // Settable via preferences
  178.  
  179.     struct RtgDimensionInfo StandardOverscan;
  180.  
  181.     // Settable via preferences
  182.  
  183.     struct RtgDimensionInfo MaxOverscan;
  184.  
  185.     // Maximum width and height (without the
  186.     // need for AutoScrolling).  Hardware
  187.     // dependant.
  188.  
  189.     ULONG ChunkySupport;
  190.  
  191.     // This LONG is used to indicate which Chunky
  192.     // modes this ScreenMode supports.  A set bit
  193.     // means the mode is available.  See the
  194.     // rtg_ChunkySupport tag for more information.
  195.     // Note that the same ScreenMode may never
  196.     // use two different layouts (for example BGR
  197.     // and RGB)
  198.  
  199.     ULONG PlanarSupport;
  200.  
  201.     // This LONG is used to indicate which Planar
  202.     // modes this ScreenMode supports.  A set bit
  203.     // means the mode is available.  See the
  204.     // rtg_PlanarSupport tag for more information.
  205.     // Note that the same ScreenMode may never
  206.     // use both interleaved and non-interleaved
  207.     // layouts.
  208.  
  209.     ULONG PixelAspect;
  210.  
  211.     // For a PAL 320x256 screen you have to write
  212.     // this value here:  sm_PixelAspect =
  213.     // (320/4)/(256/3) * 65536
  214.     //
  215.     // This tells the relation between the height and
  216.     // the width of a single pixel on 4:3 screen.  For
  217.     // a 640x480 screen this value is 1*65536.
  218.  
  219.     ULONG VertScan;
  220.  
  221.     // Vertical scan rate of this screenmode
  222.     // (in Hz)
  223.  
  224.     ULONG HorScan;
  225.  
  226.     // Horizontal scan rate of this screenmode
  227.     // (in Hz)
  228.  
  229.     ULONG PixelClock;
  230.  
  231.     // Pixelclock rate (in Hz)
  232.  
  233.     ULONG VertBlank;
  234.  
  235.     // Vertical blank rate of this screenmode
  236.     // (in Hz)  (How often the VBlank interupt
  237.     // is triggered)
  238.  
  239.     ULONG Buffers;
  240.  
  241.     // The number of buffers this ScreenMode can
  242.     // can handle.  This should always be atleast
  243.     // 1, 2 if the Screen can do double-buffering
  244.     // and 3 if it can do triple-buffering.
  245.  
  246.     UWORD BitsRed;
  247.  
  248.     // The number of bits per gun for Red
  249.  
  250.     UWORD BitsGreen;
  251.  
  252.     // The number of bits per gun for Green
  253.  
  254.     UWORD BitsBlue;
  255.  
  256.     // The number of bits per gun for Blue
  257. };
  258.  
  259. // The TagItem ID's (ti_Tag values) for GetRtgScreenData()
  260.  
  261. // These tags are used to return data to the user about the RtgScreen
  262. // structure in a future compatible way.
  263.  
  264. #define grd_Dummy TAG_USER
  265.  
  266. #define grd_Width (grd_Dummy + 0x01)
  267.  
  268. // Gets you the Width in pixels of the screen
  269.  
  270. #define grd_Height (grd_Dummy + 0x02)
  271.  
  272. // Gets you the Height in pixels of the screen
  273.  
  274. #define grd_PixelLayout (grd_Dummy + 0x03)
  275.  
  276. // Gets you the pixellayout of the screen, see
  277. // defines below.  This also tells you whether
  278. // the screen is Chunky or Planar
  279.  
  280. #define grd_ColorSpace (grd_Dummy + 0x04)
  281.  
  282. // Gets you the colorspace of the screen, see
  283. // defines below
  284.  
  285. #define grd_Depth (grd_Dummy + 0x05)
  286.  
  287. // The number of colors LOG 2.  For Planar modes
  288. // this also tells you the number of bitplanes.
  289. // Don't rely on this number except to get the
  290. // number of colors for Chunky modes.
  291.  
  292. #define grd_PlaneSize (grd_Dummy + 0x06)
  293.  
  294. // Tells you the number of bytes to skip to get
  295. // to the next (bit)plane.  You can use this to
  296. // find the start addresses of the other (bit)planes
  297. // in Planar and in (BytePlane) Chunky modes
  298.  
  299. #define grd_BytesPerRow (grd_Dummy + 0x07)
  300.  
  301. // The number of bytes taken up by a row.  This
  302. // refers to one (bit/byte)plane only for modes
  303. // working with planes.
  304.  
  305. #define grd_MouseX (grd_Dummy + 0x08)
  306.  
  307. // Finds out the Mouse X position
  308.  
  309. #define grd_MouseY (grd_Dummy + 0x09)
  310.  
  311. // Finds out the Mouse Y position
  312.  
  313. // The TagItem ID's (ti_Tag values) for GetGfxCardData()
  314.  
  315. // These tags are used to return data to the user about the graphics card
  316. // which the RtgScreen uses.
  317.  
  318. #define grd_BusSystem (grd_Dummy + 0x0A)
  319.  
  320. #define grd_Z3 1 // Zorro III Bus
  321. #define grd_Z2 2 // Zorro II Bus
  322. #define grd_Custom 3 // Custom Chipset
  323. #define grd_RGBPort 4 // Board connected to RGB Port
  324. #define grd_GVP 5 // GVP "special" Bus of GVP Turbo Board (EGS110 GFX Board)
  325. #define grd_DDirect 6 // DraCo Direct Bus
  326.  
  327. // defines for grd_PixelLayout
  328.  
  329. #define grd_PLANAR     0 // Non interleaved planar layout [X bitplanes/pixel]
  330. #define grd_PLANATI    1 // Interleaved planar layout     [X bitplanes/pixel]
  331. #define grd_CHUNKY     2 // 8-bit Chunky layout           [BYTE/pixel]
  332. #define grd_HICOL15    3 // 15-bit Chunky layout          [WORD/pixel]
  333. #define grd_HICOL16    4 // 16-bit Chunky layout          [WORD/pixel]
  334. #define grd_TRUECOL24  5 // 24-bit Chunky layout          [3 BYTES/pixel]
  335. #define grd_TRUECOL24P 6 // 24-bit Chunky layout          [3 BYTEPLANES/pixel]
  336. #define grd_TRUECOL32  7 // 24-bit Chunky layout          [LONG/pixel]
  337. #define grd_GRAFFITI   8 // 8-bit Graffiti-type Chunky layout (very special...)
  338. #define grd_TRUECOL32B 9
  339.  
  340. // defines for grd_ColorSpace
  341.  
  342. #define grd_Palette 0 // Mode uses a Color Look-Up Table (CLUT)
  343. #define grd_RGB     1 // Standard RGB color space
  344. #define grd_BGR     2 // high-endian RGB color space, BGR
  345. #define grd_RGBPC   3 // RGB with lowbyte and highbyte swapped
  346. #define grd_BGRPC   4 // BGR with lowbyte and highbyte swapped
  347.  
  348. // End of GetRtgScreenData() enumeration ***
  349.  
  350.  
  351. // Information about the RtgScreenModeReq tags:
  352. //
  353. // Each tag specified for the RtgScreenModeReq() function limits in some
  354. // way the number of ScreenModes available to the user.  Sometimes this
  355. // means a screenmode is completely ommited, and sometimes this means
  356. // certain screenmodes can only be used if the user selects them to
  357. // be wide enough.  So for example, a ScreenMode which supports screens
  358. // of 300 to 400 pixels in width, could be filtered out completely by
  359. // setting smr_MinWidth to 401.  But if the smr_MinWidth is set to for
  360. // example 320 then the user is allowed to select a width of 320-400
  361. // pixels (for this ScreenMode, and if the smr_MaxWidth allows this).
  362. // If smr_MinWidth is 200 pixels then the ScreenMode is the limiting
  363. // factor which means the user can't select ScreenModes smaller than
  364. // 300 pixels.
  365. //
  366. // The PlanarSupport and ChunkySupport tags determine which ScreenModes
  367. // are available to the user depending on their layout and number of
  368. // colors.
  369. // This structure is private and for the internal use of RtgMaster.library
  370. // and its sub-libraries ONLY.  This structure will change in the future.
  371.  
  372. struct ScreenReq
  373. {
  374.     struct ScreenMode *ScreenMode;
  375.  
  376.     // Ptr to ScreenMode structure
  377.  
  378.     ULONG Width;
  379.  
  380.     // Must be within Tag specified limits
  381.  
  382.     ULONG Height;
  383.  
  384.     // The width and height which the user selected
  385.  
  386.     UWORD Depth;
  387.  
  388.     // Number of colors log2 which the user selected
  389.     UWORD Overscan;
  390.  
  391.     // 0 = No Overscan.  See defines below.
  392.  
  393.     UBYTE Flags; // For the meaning of the bits see below
  394. };
  395.  
  396. // Bits set in ScreenMode.Flags
  397.  
  398. #define sq_EHB          (1 << 0)   // EHB selected (sq_Depth = 6)
  399. #define sq_CHUNKYMODE   (1 << 1)   // Chunky Mode selected
  400. #define sq_DEFAULTX     (1 << 2)   // Default Width selected
  401. #define sq_DEFAULTY     (1 << 3)   // Default Height selected
  402.  
  403. // defines for Overscan
  404.  
  405. #define sq_NOOVERSCAN       0
  406. #define sq_TEXTOVERSCAN     1 // User settable, should be entirely visible
  407. #define sq_STANDARDOVERSCAN 2 // Standard overscan (just past edges)
  408. #define sq_MAXOVERSCAN      3 // Maximum overscan (as much as possible)
  409.  
  410. // This structure is private and for the internal use of RtgMaster.library
  411. // and its sub-libraries ONLY.  This structure will change in the future.
  412.  
  413. struct RtgScreen
  414. {
  415.     ULONG LibBase;
  416.     UWORD LibVersion;
  417.     UWORD Pad1;
  418.     ULONG GraphicsBoard;
  419.     BYTE  Reserved[20];
  420.     ULONG MouseX;
  421.     ULONG MouseY;
  422.     APTR  c2pcode;
  423.     APTR  c2pdata;
  424.     ULONG c2pcurr;
  425.     BYTE  c2pname[30];
  426. };
  427.  
  428. #endif
  429.  
  430.